package com.lanou.mynews.movie;

import android.app.Activity;
import android.os.Bundle;
import android.widget.GridView;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;
import com.lanou.mynews.R;

import java.util.List;


public class PhotoActivity extends Activity {
    private GridView gridView;//定义一个列表组件
    private PhotoAdapter photoAdapter;//定义一个自定义适配器
    private List<Content.FilmListEntity.PictureListEntity> picture;
    private RequestQueue requestQueue;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home);

        requestQueue = Volley.newRequestQueue(this);// 初始化请求队列

        gridView = (GridView) findViewById(R.id.gridView);

        Content result = (Content) getIntent().getBundleExtra("tp").getSerializable("imageList");
        if (result != null && result.getFilmList().get(0).getPictureList() != null) {
            picture = result.getFilmList().get(0).getPictureList();
//            Log.d("lanou", "onResponse() called with: " + "response = [" + response + "]");

            //绑定适配器
            photoAdapter = new PhotoAdapter(PhotoActivity.this, picture);
            gridView.setAdapter(photoAdapter);

        }


    }
}
